<cfsetting enablecfoutputonly="true">
<cfswitch expression="#thisTag.executionMode#">
	<cfcase value="start">
		<cfparam name="attributes.id" default="">
		<cfparam name="attributes.value" default="">
		<cfparam name="attributes.src" default="">
		<cfparam name="attributes.position" default="">
		<cfparam name="attributes.before" default="">
		<cfparam name="attributes.after" default="">
		<cfscript>
		attributes.type="js";
		
		if(StructKeyExists(caller,'root')){
			root = caller.root;
		} else {
			root = caller;
		}
		</cfscript>
		<cfif NOT thisTag.hasEndTag>
			<cfthrow detail="End tag required" message="All coop tags require an end tag." errorcode="sos.tag.attributes">
		</cfif>
		<cfif NOT structKeyExists(root,"coop")>
			<cfthrow detail="Missing required COOP object on calling page.">
		</cfif>
		<cfscript>
		standardAttributes = 'id';
		attributes = root.coop.mergeAttributes(attributes,root);
		attributeList = root.coop.createAttributeList(attributes,standardAttributes,root);
		</cfscript>
	</cfcase>
	<cfcase value="end">
		<cfscript>
		if(! len(attributes.value)){
			attributes.value = thisTag.generatedContent;
		}
		if(! len(attributes.src)){
			attributes.content = attributes.value;
			if(! refindnocase("\s*<script",attributes.content)){
				attributes.content = "
	<script>#attributes.content#
	</script>";
			}
		}
		
		root.coop.sosContent.addHeadContent(argumentCollection:attributes);
		
		thisTag.generatedContent = "";
		</cfscript>
	</cfcase>
</cfswitch>
<cfsetting enablecfoutputonly="false">